package Method;

import java.util.Random;

/**
 * ClassName:MethodDemo12
 * Package:Method
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/12-11:50
 * @Version:v1.0
 */
public class MethodDemo12 {
    public static void main(String[] args) {
        int []arr={25,65,94,84,74,52,3,54};
        Random sc = new Random();
//        ifNum(sc.nextInt(100),arr);
        System.out.println(ifNum(sc.nextInt(100),arr));
    }
    public static boolean ifNum(int number, int []arr){
        System.out.println("随机数是"+number);
        for (int i = 0; i <arr.length; i++) {
            if(arr[i]==number){
                return true;
            }
        }
        return false;
    }
}
